﻿using NDF.DataAccess.EntityFramework;
using NDF.DataAccess.EntityFramework.Migrations;
using NDF.Framework.Models.Entities;
using NDF.Test.DataAccess.NdfEFTest.Entities;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NDF.Test.DataAccess.NdfEFTest
{
    public class NdfTestContext : NDF.DataAccess.EntityFramework.DbContext
    {
        public NdfTestContext() : base("name=NdfTestContext")
        {
        }


        //public virtual DbSet<UserEntity> Users { get; set; }

        public virtual DbSet<TestEntity> TestEntities { get; set; }

        protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelBuilder)
        {
        }




        static NdfTestContext()
        {
            //Database.SetInitializer<NdfTestContext>(new CreateDatabaseIfNotExists<NdfTestContext>());
            //Database.SetInitializer<NdfTestContext>(new NdfTestContextInitializer());
            Database.SetInitializer<NdfTestContext>(new DropCreateDatabaseIfModelChanges<NdfTestContext>());
        }
    }


    public class TestEntity : EntityBase
    {
        public virtual string Name { get; set; }
    }
}
